package com.zx.testkotlin

import android.content.Intent
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.widget.Toast
import com.zx.testkotlin.model.PersonModel
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        getDateLoc()
    }

    private fun getDateLoc() {
        var model = PersonModel()
        model.id = 1
        model.name = "周小小"
        model.isSex = true
        text1.text = model.name
        text1.setOnClickListener {
            Toast.makeText(this@MainActivity, "hhh", Toast.LENGTH_SHORT).show()
            startActivity(Intent(this, ListActivity::class.java))
        }
    }

    public fun showView(): Int {
        return 1
    }


}
